package de.dhbw.karlsruhe.picsim.gui.control;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;

/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: May 6, 2010
 * Time: 12:18:59 AM
 */
public final class ResetAction extends AbstractAction {
    private static final Log log = LogFactory.getLog(ResetAction.class);
    private final ImportLstAction importLstAction;
    private final File file;

    public ResetAction(ImportLstAction importLstAction, final File file) {
        super("Reset");
        this.importLstAction = importLstAction;
        this.file = file;
    }

    @Override
    public void actionPerformed(final ActionEvent e) {
        try {
            importLstAction.importLST(file);
        } catch (IOException e1) {
            log.error(e1);
        }

    }
}
